package com.hoshino.momochi.service.Impl;

import com.hoshino.momochi.mapper.CommentMapper;
import com.hoshino.momochi.model.domain.Blog;
import com.hoshino.momochi.model.domain.Comment;
import com.hoshino.momochi.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentMapper commentMapper;

    @Override
    public void addComment(Comment comment) {
        commentMapper.addComment(comment);
    }

    @Override
    public void delCommentByTwoId(Long id, Long uid) {
        commentMapper.delCommentByTwoId(id, uid);
    }

    @Override
    public List<Comment> getUserComment(Long uid) {
        return commentMapper.getUserComment(uid);
    }

    @Override
    public List<Comment> getTreeComment(Long bid) {
        return commentMapper.getTreeComment(bid);
    }

    @Override
    public void replyComment(Comment comment) {
        commentMapper.replyComment(comment);
    }

    @Override
    public List<Comment> getReplyCommentFromMe(Long uid) {
        return commentMapper.getReplyCommentFromMe(uid);
    }

    @Override
    public List<Blog> getMyReplyBlogInfo(Long uid) {
        return commentMapper.getMyReplyBlogInfo(uid);
    }

    @Override
    public void delIsDeleteAsTrue() {
        commentMapper.delIsDeleteAsTrue();
    }
}
